package com.menhai.personmanagement.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.menhai.personmanagement.entity.TjWordsTemplate;
import com.menhai.personmanagement.entity.vo.MbReportCardVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author shikun
 * @since 2022-01-12
 */
@Mapper
public interface TjWordsTemplateMapper extends BaseMapper<TjWordsTemplate>{

	/**
	 * 获取模板列表
	 * @param templateContent
	 * @return
	 */
	public IPage<TjWordsTemplate> getTemplateList(@Param("page")Page<MbReportCardVo> page,@Param("tjWordsTemplate")TjWordsTemplate TjWordsTemplate);

	/**
	 * 插入模板
	 */
	public int insert(TjWordsTemplate TjWordsTemplate);
	
	/**
	 * 删除模板
	 * @param templateId
	 * @return
	 */
	public int delete(@Param("templateId")String templateId);
	
	/**
	 * 编辑模板
	 * @param TjWordsTemplate
	 * @return
	 */
	public int update(TjWordsTemplate TjWordsTemplate);


	@Select("select * from tj_words_template where parent_template_id=#{parent_template_id}")
	public List<TjWordsTemplate> findWordsById(@Param("parent_template_id") String parent_template_id);
}
